import request from '@/utils/request'

// 查询分类列表
export function listClassification (query) {
  return request({
    url: '/system/classification/list',
    method: 'get',
    params: query
  })
}

// 查询分类详细
export function getClassification (id) {
  const params = {
    'id': id
  }
  return request({
    url: '/system/classification/getInfo',
    method: 'get',
    params: params
  })
}

// 新增分类
export function addClassification (data) {
  return request({
    url: '/system/classification/insert',
    method: 'post',
    data: data
  })
}

// 修改分类
export function updateClassification (data) {
  return request({
    url: '/system/classification/update',
    method: 'post',
    data: data
  })
}

// 删除分类
export function delClassification (id) {
  const params = {
    'id': id
  }
  return request({
    url: '/system/classification/delete',
    method: 'post',
    params: params
  })
}
// 批量删除分类
export function delBatchClassification (ids) {
  const params = {
    'ids': ids
  }
  return request({
    url: '/system/classification/deleteBatch',
    method: 'post',
    params: params
  })
}

// 导入分类
export function importData (data) {
  return request({
    url: '/system/classification/importData',
    method: 'post',
    data: data
  })
}
